objects=nat64d.o dump.o checksum.o translate.o ipv4.o ipv6.o config.o dhcpcd-files/netlink.o dhcpcd-files/memory.o dns64.o logging.o getaddr.o
CFLAGS=-Wall -I.
CC=agcc

all: clatd

.PHONY: disclean package install clean 
clean: distclean

distclean:
	rm -f *.o clatd dhcpcd-files/*.o

clatd: $(objects)
	$(CC) $(objects) libcutils.a -o clatd -llog

install: all
	install -d $(DESTDIR)/system/bin
	install -m755 clatd $(DESTDIR)/system/bin/

dns64.o: dns64.h logging.h dhcpcd-files/memory.h
dhcpcd-files/netlink.o: dhcpcd-files/netlink.h dhcpcd-files/memory.h
dhcpcd-files/memory.o: dhcpcd-files/memory.h
config.o: dns64.h config.h dhcpcd-files/memory.h logging.h getaddr.h
nat64d.o: system_headers.h ipv4.h ipv6.h nat64d.h config.h dhcpcd-files/netlink.h logging.h
dump.o: system_headers.h checksum.h
checksum.o: system_headers.h checksum.h
translate.o: system_headers.h checksum.h nat64d.h config.h
ipv4.o: system_headers.h translate.h checksum.h ipv4.h logging.h
ipv6.o: system_headers.h translate.h checksum.h ipv6.h logging.h
logging.o: logging.h
getaddr.o: getaddr.h
